# Create your views here.
from apps.profiles.models import Department, Zar
from django.template import RequestContext
from django.shortcuts import render_to_response

def show_home(request):
    all_department = Department.objects.all()
    all_ads = Zar.objects.all()
    
    return render_to_response('main.html', {'all_department': all_department, 
                                            'all_ads': all_ads}, 
                                context_instance=RequestContext(request))

def department_detail(request, department_id):
    try:
        obj = Department.objects.get(pk=department_id)
    except Department.DoesNotExist:
        raise Http404
    return render_to_response('main.html', {'department': obj},
                              context_instance=RequestContext(request))



    
    